package com.example.coffeesystem.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;


@Data
@NoArgsConstructor//无参构造
@AllArgsConstructor//全参构造
@ToString//tostring方法
public class Staff implements UserDetails {
    private String Sno;
    private float Salary;
    private String Sname;
    private String Sex;
    private String Contact;
    private Boolean State;
    private String Password;

//    权限数据
    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

//    用户名
    @Override
    public String getUsername() {
        return Sname;
    }

//    账号是否过期
    @Override
    public boolean isAccountNonExpired() {
        return false;
    }

//    账号是否被锁定
    @Override
    public boolean isAccountNonLocked() {
        return false;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return false;
    }

//    是否被禁用
    @Override
    public boolean isEnabled() {
        return State;
    }
}
